<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<head>
	<title><fmt:message key='menu.reportcount.r3' />
	</title>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/highcharts/highcharts.js'/>">
</script>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/highcharts/exporting.js'/>">
</script>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/report/report.js'/>">
</script>
<script type="text/javascript"
		src="<c:url value='/ext/scripts/tab.js'/>">
</script>
	<script type="text/javascript">
function getListByProperties(strvalue) {
	return strvalue.split(',');
}
function hiddenselectconbyid(divid) {
	if ($(divid).style.display == 'none') {
		$(divid).style.display = '';
	} else {
		$(divid).style.display = 'none';
	}
}

jQuery(document)
		.ready(
				function() {
					var usernum = "<fmt:message key='count.num'/>";
					var usernumline = "<fmt:message key='count.collect.num'/>";
					var countstr = "<fmt:message key='report.countstr'/>";
					var brands = "<fmt:message key='count.report.brands'/>";
					var titletxt = "<fmt:message key='report.coolect.count'/>";
					jQuery("#buttonsearchid").click(
							function() {
								reportinfo("../report/collectpicreport.html",
										titletxt, usernum, usernumline,
										countstr, brands);
							});
					reportinfo("../report/collectpicreport.html", titletxt,
							usernum, usernumline, countstr, brands);

					var pleaseselect = "<fmt:message key='count.plasce.select' />";
					//每次选择卫星时,获取相应的传感器  
					jQuery("#satellteid").change(function() {
						selectsensor(pleaseselect);
					});

					var countterritoryvalue = "<fmt:message key='report.coolect.grouplist'/>";
					var countterritoryvalueno = "<fmt:message key='report.coolect.grouplistno'/>";
					var countpicvalue = "<fmt:message key='count.pic.info'/>";

					var countterritorylist = getListByProperties(countterritoryvalue);
					var countterritorylistno = getListByProperties(countterritoryvalueno);
					var countpiclist = getListByProperties(countpicvalue);

					for ( var i = 0; i < countterritorylist.length - 1; i++) {
						jQuery('#countterritoryid').append(
								"<option value='" + countterritorylistno[i]
										+ "'>" + countterritorylist[i]
										+ "</option>");
					}
					for ( var i = 0; i < countpiclist.length; i++) {
						jQuery('#countpicid').append(
								"<option value='" + (i + 1) + "'>"
										+ countpiclist[i] + "</option>");
					}

				});
</script>
</head>

<div id="main">
	<div id="content">
		<div class="box_big" style="padding-bottom: 15px;">
			<div class="bj_biao">
				<a onfocus="this.blur()" href="###" class="on" name="tab" id="tab1"
					onclick="sjTabDo(this.id,this.name)"><span><font><fmt:message
								key="count.list.count" /> </font> </span> </a><a onfocus="this.blur()" href="###"
					id="tab2" name="tab" onclick="sjTabDo(this.id,this.name)"><span><font><fmt:message
								key="count.pic.report" /> </font> </span> </a>
			</div>
			<div id="tab1_con">
				<div class="box5">
					<form:form commandName="reportview"
						action="${ctx}/report/collectreport.html" method="post">
						<table border="0" cellspacing="9" cellpadding="0">
							<tr>
								<td colspan="3">
									<div class="lable_box" style="width: 775px">
										<h3>
											<fmt:message key="count.search.condition" />
										</h3>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td align="right">
													<fmt:message key="report.order.username" />
													:
												</td>
												<td align="left">
													<form:input path="username" size="12" />
												</td>
												<td align="right">
													<fmt:message key="report.order.companyname" />
													:
												</td>
												<td align="left">
													<form:input path="company" size="12" />
												</td>
												<td align="right">
													<fmt:message key="report.collect.numcollecttime" />
													:
												</td>
												<td>
													<form:input path="collectstarttime" size="12"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'});"
														cssClass="time" />
													<fmt:message key="zywx.timefrom" />
													<form:input path="collectendtime" size="12"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'});"
														cssClass="time" />
												</td>
											</tr>
											<tr>
												<td align="right">
													<fmt:message key="report.order.satellte" />
													:
												</td>
												<td align="left">
													<form:select id="satellteid" path="satellte">
														<option value="">
															<fmt:message key="count.plasce.select" />
														</option>
														<c:forEach var="str" items="${satellite}">
															<form:option value='${str}'>${str}</form:option>
														</c:forEach>
													</form:select>
												</td>
												<td align="right">
													<fmt:message key="report.order.sensor" />
													:
												</td>
												<td align="left">
													<form:select id="sensorid" path="sensor">
														<option id="old" value="">
															<fmt:message key="count.plasce.select" />
														</option>
														<c:forEach var="str" items="${senor}">
															<form:option id="old" value='${str}'>${str}</form:option>
														</c:forEach>
													</form:select>
												</td>
												<td align="right">
													<fmt:message key="report.collect.collectordertime" />
													:
												</td>
												<td>
													<form:input path="startime" size="12"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'});"
														cssClass="time" />
													<fmt:message key="zywx.timefrom" />
													<form:input path="endtime" size="12"
														onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'});"
														cssClass="time" />
												</td>
											</tr>
										</table>
									</div>
								</td>
							</tr>
							<tr>
								<td width="255">
									<div class="lable_box" style="width: 255px">
										<h3>
											<fmt:message key="count.group.condition" />
										</h3>
										<table width="76%" border="0" cellspacing="0" cellpadding="0"
											class="mar_0">
											<tr>
												<td align="right">
													<fmt:message key="report.order.user" />
												</td>
												<td>
													<form:checkbox path="group" value="c.username" />
												</td>
												<td align="right">
													<fmt:message key="report.order.company" />
												</td>
												<td>
													<form:checkbox path="group" value="u.company" />
												</td>
												<td align="right">
													<fmt:message key="report.order.satellte" />
												</td>
												<td>
													<form:checkbox path="group" value="c.satelliteid" />
												</td>
												<td align="right">
													<fmt:message key="report.order.sensor" />
												</td>
												<td>
													<form:checkbox path="group" value="c.sensorid" />
												</td>
											</tr>
										</table>
									</div>
								</td>
								<td width="285">
									<div class="lable_box" style="width: 285px">
										<h3>
											<fmt:message key="count.order.condition" />
										</h3>
										<table width="80%" border="0" cellspacing="0" cellpadding="0"
											class="mar_0">
											<tr>
												<td align="right">
													<fmt:message key="report.order.user" />
												</td>
												<td>
													<form:checkbox path="order" value="c.username" />
												</td>
												<td align="right">
													<fmt:message key="report.order.company" />
												</td>
												<td>
													<form:checkbox path="order" value="u.company" />
												</td>
												<td align="right">
													<fmt:message key="report.order.satellte" />
												</td>
												<td>
													<form:checkbox path="order" value="c.satelliteid" />
												</td>
												<td align="right">
												</td>
												<td>
												</td>
											</tr>
											<tr>
												<td align="right">
													<fmt:message key="report.order.sensor" />
												</td>
												<td>
													<form:checkbox path="order" value="c.sensorid" />
												</td>
												<td align="right">
													<fmt:message key="count.num" />
												</td>
												<td>
													<form:checkbox path="order" value="num" />
												</td>
												<td align="right">
												</td>
												<td>
												</td>
												<td align="right">
												</td>
												<td>
												</td>
											</tr>
										</table>
									</div>
								</td>
								<td width="165">
									<div class="lable_box" style="width: 165px">
										<h3>
											<fmt:message key="count.order.style" />
										</h3>
										<table width="70%" border="0" cellspacing="0" cellpadding="0"
											class="mar_0">
											<tr>
												<td align="right">
													<fmt:message key="count.order.asc" />
												</td>
												<td>
													<form:radiobutton checked="checked" path="sortDesc"
														value="asc" />
												</td>
												<td align="right">
													<fmt:message key="count.order.desc" />
												</td>
												<td>
													<form:radiobutton path="sortDesc" value="desc" />
												</td>
											</tr>
										</table>
									</div>
								</td>
							</tr>
						</table>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr height="30" valign="top">
								<td align="center">
									<input type="submit" class="btn_cx2"
										value="<fmt:message key="button.search"/>" />
								</td>
							</tr>
						</table>
					</form:form>
				</div>
				<div class="ceng_mar5">
					<c:if test="${listresult==true}">
						<display:table name="collectlist" cellspacing="0" cellpadding="0"
							requestURI="" style="width:100%;" id="collectreport"
							class="table_cx" export="true">
							<c:if test="${null!=collectreport.username}">
								<display:column property="username" escapeXml="true"
									sortable="true" titleKey="report.order.user"
									style="border-left:1px solid #feb808;" />
							</c:if>
							<c:if test="${null!=collectreport.company}">
								<display:column property="company" escapeXml="true"
									sortable="true" titleKey="report.order.company"
									style="border-left:1px solid #feb808;" />
							</c:if>
							<c:if test="${null!=collectreport.satellte}">
								<display:column property="satellte" escapeXml="true"
									sortable="true" titleKey="report.order.satellte" />
							</c:if>
							<c:if test="${null!=collectreport.sensor}">
								<display:column property="sensor" escapeXml="true"
									sortable="true" titleKey="report.order.sensor" />
							</c:if>
							<c:if test="${null!=collectreport.receivestation}">
								<display:column property="receivestation" escapeXml="true"
									sortable="true" titleKey="report.order.receivestation" />
							</c:if>
							<display:column sortable="true" titleKey="report.collect.status">
								<c:if test="${collectreport.collectStatus=='default'}">
									<fmt:message key="report.collect.default" />
								</c:if>
								<c:if test="${collectreport.collectStatus=='scheduled'}">
									<fmt:message key="report.collect.scheduled" />
								</c:if>
								<c:if test="${collectreport.collectStatus=='cooected'}">
									<fmt:message key="report.collect.cooected" />
								</c:if>
								<c:if test="${collectreport.collectStatus=='denied'}">
									<fmt:message key="report.collect.denid" />
								</c:if>
							</display:column>
							<display:column property="num" escapeXml="true" sortable="true"
								titleKey="report.order.ordernum" />
							<display:setProperty name="export.pdf" value="false" />
							<display:setProperty name="export.csv" value="false" />
							<display:setProperty name="export.xml" value="false" />
						</display:table>
					</c:if>
					<div align="center">
						<c:if test="${listresult==false}">
							<fmt:message key="report.resultlist.null" />
						</c:if>
					</div>
				</div>
			</div>
			<div id="tab2_con" style="display: none">
				<div class="box5">
					<table width="750" border="0" cellspacing="0" cellpadding="0"
						class="fz_12">
						<tr>
							<td align="right">
								<fmt:message key="report.collect.collectordertime" />
								:
							</td>
							<td align="left">
								<input id="starttimeid" name="starttime" type="text" size="12"
									class="time"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'})" />
								<fmt:message key="zywx.timefrom" />
								<input id="endtimeid" name="endtime" type="text" size="12"
									class="time"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'${lang}'})" />
							</td>
							<td align="right">
								<fmt:message key="count.pic.company" />
								:
							</td>
							<td align="left">
								<select id="countterritoryid" name="countterritory"></select>
							</td>
							<td align="right">
								<fmt:message key="count.pic.type" />
								:
							</td>
							<td align="left">
								<select id="countpicid" name="countpic"></select>
							</td>
							<td>
								<input type="button" id="buttonsearchid" class="btn_cx2"
									value="<fmt:message key="button.search"/>" />
							</td>
						</tr>
					</table>
				</div>
				<div class="box5">
					<div id="container"
						style="width: 90%; height: 400px; margin: 0 auto"></div>
				</div>
			</div>
		</div>
	</div>
</div>